<?xml version="1.0" encoding="utf-8" ?>
<Batch
    xmlns="http://schemas.dbshell.com/core"
    xmlns:ds="http://schemas.dbshell.com/dataset"
    >
    <QueryValue VariableName="var1">
        SELECT COUNT(*) FROM MediaType
    </QueryValue>
    <ForEach Source="{Query 'SELECT * FROM Album'}">
        
    </ForEach>
    <ds:DataSet VariableName="ds1">
        <ds:AddRow Table="Album" Condition="AlbumId=1" />
        <ds:LoadReference FkTable="Track" PkTable="Album" />
        <ds:LoadMissing Table="Genre" />
        <ds:LoadMissing Table="MediaType" />
    </ds:DataSet>

    <ds:WriteSql DataSet="{Eval ds1}" File="test1.sql" >
        <ds:Lookup Table="Genre" IdColumn="GenreId" ValueColumn="Name" />
    </ds:WriteSql>
</Batch>    
